GitHub Actionsでのnpm ci時間を短縮する
from Github Actionsでcacheする
actions/setup-nodeにcacheの仕組みが用意されている
docs
lock.jsonが生成したhashを見てcacheを管理
github actionsのdocs
code:yml
jobs:
build:
name: build angular
runs-on: ubuntu-latest
steps:
- name: Checkout repo
uses: actions/checkout@v3
with:
fetch-depth: 0
- name: setup Node
uses: actions/setup-node@v3
with:
node-version: 18
cache: npm # この行を追加
- run: npm ci
- run: npm run lint
- run: npm run build
#??
なんかcacheが利用さている感じがないな
https://dev.classmethod.jp/articles/caching-dependencies-in-workflow-execution-on-github-actions/
結局actions/cache使ってる